package com.wangfei.lecture.fanweiyunsuanfu;

import org.junit.Test;

import java.util.function.Consumer;

public class LambdaTest {

    public static void main(String[] args) {
        Runnable r1 = new Runnable(){
            @Override
            public void run() {
                System.out.println("woomen");
            }
        };
        r1.run();
        System.out.println("+++++++++++++++++++++++++++");
        Runnable r2 = () -> {System.out.println("The second way");};
        r2.run();
    }
    @Test
    public void test2() {
        Consumer<String> con = new Consumer<String>(){

            @Override
            public void accept(String o) {
                System.out.println(o);
            }
        };
        con.accept("consumer's outpu");
    }
}
